using Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ELF.Infrastructure.Data.Configurations;

public class QuestionConfiguration : IEntityTypeConfiguration<Question>
{
    public void Configure(EntityTypeBuilder<Question> builder)
    {
        builder.HasKey(t => t.Id);
        builder.Property(t => t.Id).ValueGeneratedNever();

        builder.Property(t => t.Title)
        .HasMaxLength(300)
        .IsRequired()
        ;

        //builder.Property(t => t.AskerId)
        //.HasMaxLength(36)
        //.IsRequired()
        //;
        builder.Property(t => t.Content)
        .HasMaxLength(5000)
        .IsRequired()
        ;
        builder.Property(t => t.Title)
        .HasMaxLength(100)
        .IsRequired()
        ;
        builder.Property(t => t.AskerDisplayName)
        .HasMaxLength(100)
        .IsRequired()
        ;
    }
}